<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f"%>
<%@ taglib uri="/mytag" prefix="yjd"%>
<div class="wrap J_check_wrap">
	<div class="nav">
		<ul class="cc">
			<li  class='current'><a href='<yjd:url url="/app/all"/>'>查询版本</a></li>
			<li ><a href='<yjd:url url="/app/to/upload"/>' >上传APP</a></li>
		</ul>
	</div>

	<form id="myform" method="post" class="J_ajaxForm" autocomplete="off" action='<yjd:url url="/app/upload/android"/>' enctype="multipart/form-data" >
		<div class="h_a">APP上传</div>
		<div class="table_full">
			<table width="100%">
				<tbody>
					<tr>
						<th width="10%">设备类型</th>
						<td>
							<select name="device_type" class="mr10" onchange="changeDevice_type(this)">
								<option value="android" selected="selected" >Android</option>
								<option value="ios" >IOS</option>
							</select>
						</td>
					</tr>
					<tr>
						<th width="10%">是否强制更新</th>
						<td><input type="radio" name="force_update" value="0" checked="checked">否</input>
							<input type="radio" name="force_update" value="1">是</input>
						 </td>
					</tr>
					<tr>
						<th width="10%">数据包名称</th>
						<td><input type="text" name="package_name" ></td>
					</tr>
					<tr>
						<th width="10%">版本号</th>
						<td><input type="text" name="app_version"> </td>
					</tr>
					<tr id="Android">
						<th>选择APP文件</th>
						<td><input name="app" type="file"></td>
					</tr>
					<tr id="IOS_url"  style="display: none;">
						<th>输入IOS应用地址</th>
						<td> <input name="url" type="text"></td>
					</tr>
					<tr id="IOS_size"  style="display: none;" >
						<th>应用大小</th>
						<td> <input name="apppackage_size" type="text"  ></td>
					</tr>
					<tr>
						<th width="10%">版本描述</th>
						<td><textarea name="update_msg" rows="5" cols="39"></textarea> </td>
					</tr>
				</tbody>
			</table>
		</div>
		<div class="btn_wrap">
			<button class="btn btn_submit J_ajax_submit_btn" type="submit">提交</button>
		</div>
	</form>
</div>
<script>
	function changeDevice_type(obj) {
		if(obj.value=='ios'){
			$("#IOS_url").show();
			$("#IOS_size").show();
			$("#Android").hide();
			$('#myform').attr('action', '<yjd:url url="/app/upload/ios"/>');
		}else{
			$("#IOS_url").hide();
			$("#IOS_size").hide();
			$("#Android").show();
			$('#myform').attr('action', '<yjd:url url="/app/upload/android"/>');
		}
	}
</script>
